import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView
    },
    {
      path:'/login',
      name:'login',
      component:()=>import("@/views/Login.vue")
    },
    {
      path: '/layout',
      name: 'layout',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/Layout.vue'),
      children:[{
        path:'user',
        name:'user',
        component:()=>import("@/views/manage/user.vue")
      },{
        path:'address',
        name:'address',
        component:()=>import("@/views/manage/address.vue")
      },{
        path:'admin',
        name:'admin',
        component:()=>import("@/views/manage/admin.vue")
      },{
        path:'bank',
        name:'bank',
        component:()=>import("@/views/manage/bank.vue")
      },{
        path:'question',
        name:'question',
        component:()=>import("@/views/manage/question.vue")
      },{
        path:'reserve',
        name:'reserve',
        component:()=>import("@/views/manage/reserve.vue")
      },{
        path:'knowledge',
        name:'knowledge',
        component:()=>import("@/views/manage/knowledge.vue")
      },{
        path:'expert',
        name:'expert',
        component:()=>import("@/views/manage/expert.vue")
      }]
    }
  ]
})

export default router
